<template>
  <require from="./em-project-edit-epic.less"></require>
  <div class="em-project-edit-epic">
            <div class="ui form">
            <div class="fields">
                <div class="four wide field">
                    <label>名称</label>
                    <input type="text" value.bind="name" placeholder="名称">
                </div>
                <div class="four wide field">
                    <label>描述</label>
                    <input type="text" value.bind="desc" placeholder="描述">
                </div>
                <div class="four wide field">
                    <label>开始时间</label>
                    <div class="ui calendar" ref="startRef">
                        <div class="ui input left icon">
                            <i class="calendar icon"></i>
                            <input type="text" value.bind="start" placeholder="开始时间">
                        </div>
                    </div>
                </div>
                <div class="four wide field">
                    <label>结束时间</label>
                    <div class="ui calendar" ref="endRef">
                        <div class="ui input left icon">
                            <i class="calendar icon"></i>
                            <input type="text" value.bind="end" placeholder="结束时间">
                        </div>
                    </div>
                </div>
                <div class="two wide field">
                    <label style="visibility: hidden;">添加</label>
                    <div click.delegate="addHandler()" class="ui icon blue circular button" title="添加史诗"><i class="plus icon"></i></div>
                </div>
            </div>
        </div>
        <div class="ui divider"></div>
        <table class="ui table">
            <thead>
                <tr>
                    <th>名称</th>
                    <th>描述</th>
                    <th>开始时间</th>
                    <th>结束时间</th>
                    <th class="right aligned">操作</th>
                </tr>
            </thead>
            <tbody>
                <tr repeat.for="item of epics">
                    <td>
                        <em-editable-input value.bind="item.name" onok.call="editNameOkHandler($event, item)"></em-editable-input>
                    </td>
                    <td>
                        <em-editable-input value.bind="item.description" onok.call="editDescOkHandler($event, item)"></em-editable-input>
                    </td>
                    <td>
                        <em-editable-calendar value.bind="item.startDate" onchange.call="editStartHandler($event, item)"></em-editable-calendar>
                    </td>
                    <td>
                        <em-editable-calendar value.bind="item.endDate" onchange.call="editEndHandler($event, item)"></em-editable-calendar>
                    </td>
                    <td class="right aligned">
                        <div class="ui horizontal bulleted list">
                            <a style="color: red;" ui-dropdown-action class="ui icon top right pointing dropdown item" title="删除状态">
                                删除
                                <div class="menu">
                                    <div style="color: red;" class="item" click.delegate="delHandler(item)"><i class="trash red outline icon"></i>确认删除</div>
                                </div>
                            </a>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
  </div>
</template>